<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2017/10/17 0017
  Time: 上午 8:16
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://"
            + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"/>
    <link href="css/style.css" rel="stylesheet"/>
    <link href="css/base.css" rel="stylesheet"/>
    <script src="js/jquery1.42.min.js" type="text/javascript"></script>
    <script src="js/jquery.SuperSlide.2.1.3.js" type="text/javascript"></script>
    <script src="js/flexible.min.js" type="text/javascript"></script>
    <script src="../../layui-v2.2.5/layui/layui.js" charset="utf-8"></script>
    <title></title>
</head>
<body style="background-color: rgb(242,242,242);">
<div>
    <div class='top_name'>
        <input type="hidden" id ="memberId" value="${memberInfo.id}">
        <div class='nameANDaccount'><span>姓名</span><input id="realName" value ="${memberInfo.realName} "/></div>
        <div class='nameANDaccount'><span>账号</span><input id="alipayAccount" value = "${memberInfo.alipayAccount}"/></div>
    </div>
    <div class='editor_account' onclick="editAlipayAccount()">修改账号</div>
</div>
<script>
    function editAlipayAccount() {
        var id =$("#memberId").val();

        var alipayAccount =$('#alipayAccount').val().trim();
        var realName =$('#realName').val().trim();
        var data ={'id':id,'alipayAccount':alipayAccount,'realName':realName};
        $.ajax({
            url: '/mobile/updateAlipayAccount',
            type: 'POST',
            async: true,
            data:data,
            dataType: 'json',
            success: function (data) {
                if (data.result) {
                    window.location.href="/mobile/toMyInfo";
                } else {
                    layui.use('layer',function(){
                       layer.msg("修改失败");
                    });

                }
            },
        });
    };
</script>
</body>
</html>